interface  IRuning{
    void Run();
}
interface  ISwimming{
    void swim();
}
abstract class Animal{
    private String name;
    private int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }
    public abstract void eat();

}
 class Dog extends Animal implements IRuning,ISwimming{
     public Dog(String name, int age) {
         super(name, age);
     }

     @Override
     public void eat() {
         System.out.println(this.getName()+"吃骨头");
     }

     @Override
     public void Run() {
         System.out.println(this.getName()+"欢快的跑");
     }

     @Override
     public void swim() {
         System.out.println(this.getName()+"狗刨");
     }
 }
 class Buck extends Animal implements IRuning,ISwimming{
     public Buck(String name, int age) {
         super(name, age);
     }

     @Override
     public void Run() {
         System.out.println(this.getName()+"跑");
     }

     @Override
     public void swim() {
         System.out.println(this.getName()+"游泳");
     }

     @Override
     public void eat() {
         System.out.println(this.getName()+"吃小鱼");
     }
 }
public class Test1 {
    public static void func1(Animal a){
        a.eat();
    }
    public static void func2(IRuning r){
        r.Run();
    }
    public static void func3(ISwimming s){
        s.swim();
    }
    public static void main(String[] args) {
        func2(new Dog("大飞",3));
        func3(new Dog("大飞",3));
        func2(new Buck("白糖",4));
        func3(new Buck("白糖",4));

    }
}
